{extend  name="manage@public/layout" /}
{block name="content"}
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5 style="margin:-5px 5px 0px !important;"><button onClick="modaldemo()" style="padding:4px;margin-bottom:0 !important" type="button" class="btn btn-primary btn-xs">添加渠道</button></h5>
                        <div class="ibox-tools">
                            <a class="collapse-link" onclick="location.replace(location.href);">
                                <i class="fa fa-refresh"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="table-responsive">
                            <!--- 搜索--->
                            <form action="" method="post">
                               
                                <div class="col-sm-2 col-sm-on">
                                    <input type="text" value="" name="keyword" placeholder="渠道名称" class="input-sm form-control">
                                </div>
                                <div class="col-sm-1 col-sm-botton">
                                    <div class="input-group">
                                        <button type="submit" class="btn btn-sm btn-primary"><i class="fa fa-search"></i></button>
                                    </div>
                                </div>
                            </form>
                            <!--- end --->
                            <table class="table table-striped table-bordered">
                                <thead>
                                    <tr>
                                        <th>ID</th>
                                        <th>渠道名称</th>
                                        <th>渠道类名</th>
                                        <th>状态</th>
                                        <th>创建时间</th>
                                        <th>更新时间</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {volist name="list" id="vo"}
                                    <tr>
                                        <td>{$vo.id}</td>
                                        <td>{$vo.title}</td>
                                        <td>{$vo.code}</td>
                                        <td>
                                            <input data-type="ch" data-url="{:url('/manage/channelState')}" {eq  name="vo.status" value="1"}checked{/eq} data-id="{$vo.id}" type="checkbox" class="js-switch"  />
                                        </td>
                                        <td>{$vo.create_time}</td>
                                        <td>{$vo.update_time}</td>
                                        <td>
                                            <a style="color: #1ab394;border: 1px solid #1ab394;" href="{:url('/manage/editChannel',['pid'=>$vo.id])}" title="编辑" type="button" data-id="1" class="btn btn-sm btn-white"><i class="fa fa-edit">&nbsp;编辑</i></a>
                                            <button style="color:red;border:1px solid red;" title="删除" type="button" data-id="{$vo.id}" class="btn btn-sm bt-ch-del btn-white"><i class="fa fa-trash-o">&nbsp;删除</i></button>
                                        </td>
                                    </tr>
                                    {/volist}
                                </tbody>
                            </table>
                            <div style="float:right;" class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
                                {$page|raw}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div> 
    <!-- 弹框 --->
    <div id="modal-demo" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
        <div class="modal-dialog">
            <div class="modal-content radius">
                <div class="modal-header">
                    <h3 class="modal-title">添加渠道</h3>
                    <a class="close" data-dismiss="modal" aria-hidden="true" href="javascript:void();">×</a>
                </div>
                <input type="hidden" name="role_id" value="0" />
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">渠道名称</label>
                        <div class="col-sm-7">
                            <input type="text" placeholder="请输入渠道名称" name="channel_name" class="form-control">
                        </div>
                    </div>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">渠道类名</label>
                        <div class="col-sm-7">
                            <input type="text" onkeyup="value=value.replace(/[^a-zA-Z]/g,'')" onblur="jsUcfirst()" placeholder="请输入渠道类名" name="channel_class" class="form-control">
                        </div>
                    </div>
                </div>
                <div class="modal-body" style="padding: 20px 30px 60px 30px !important;">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">回调IP</label>
                        <div class="col-sm-7">
                            <textarea id="white_ip" class="input-sm form-control" rows="4" cols="30" style="border: 1px solid #e5e6e7;" placeholder="多个ip用|隔开" name="white_ip"></textarea>
                        </div>
                    </div>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">状态</label>
                        <div class="col-sm-7">
                            <div class="radio i-checks">
                                <label style="padding-left: 0 !important;"><input type="radio" name="status" checked value="1"> <i></i> 开启</label>
                                <label><input type="radio" name="status" value="2"> <i></i> 关闭</label>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button class="btn btn-primary btn-channel btn-mch">确定</button>
                    <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
                </div>
            </div>
        </div>
    </div>
    <!--  end --->
    {/block}
    {block name="script"}
<script src="/static/js/admin/channel.js"></script>
{/block}

